package edge;

import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;

/**
 * <pre>
 * 数据上报方法定义
 * </pre>
 */
@javax.annotation.Generated(
        value = "by gRPC proto compiler (version 1.0.0)",
        comments = "Source: device.proto")
public class UploadServiceGrpc {

    private UploadServiceGrpc() {
    }

    public static final String SERVICE_NAME = "edge.UploadService";

    // Static method descriptors that strictly reflect the proto.
    @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
    public static final io.grpc.MethodDescriptor<edge.EdgeMessage.RequestData,
            edge.EdgeMessage.Result> METHOD_REGISTER_DEVICE =
            io.grpc.MethodDescriptor.create(
                    io.grpc.MethodDescriptor.MethodType.UNARY,
                    generateFullMethodName(
                            "edge.UploadService", "RegisterDevice"),
                    io.grpc.protobuf.ProtoUtils.marshaller(edge.EdgeMessage.RequestData.getDefaultInstance()),
                    io.grpc.protobuf.ProtoUtils.marshaller(edge.EdgeMessage.Result.getDefaultInstance()));
    @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
    public static final io.grpc.MethodDescriptor<edge.EdgeMessage.RequestData,
            edge.EdgeMessage.Result> METHOD_UPLOAD_STATUS =
            io.grpc.MethodDescriptor.create(
                    io.grpc.MethodDescriptor.MethodType.UNARY,
                    generateFullMethodName(
                            "edge.UploadService", "UploadStatus"),
                    io.grpc.protobuf.ProtoUtils.marshaller(edge.EdgeMessage.RequestData.getDefaultInstance()),
                    io.grpc.protobuf.ProtoUtils.marshaller(edge.EdgeMessage.Result.getDefaultInstance()));
    @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
    public static final io.grpc.MethodDescriptor<edge.EdgeMessage.RequestData,
            edge.EdgeMessage.Result> METHOD_UPLOAD_PROPERTY =
            io.grpc.MethodDescriptor.create(
                    io.grpc.MethodDescriptor.MethodType.UNARY,
                    generateFullMethodName(
                            "edge.UploadService", "UploadProperty"),
                    io.grpc.protobuf.ProtoUtils.marshaller(edge.EdgeMessage.RequestData.getDefaultInstance()),
                    io.grpc.protobuf.ProtoUtils.marshaller(edge.EdgeMessage.Result.getDefaultInstance()));
    @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
    public static final io.grpc.MethodDescriptor<edge.EdgeMessage.RequestData,
            edge.EdgeMessage.Result> METHOD_UPLOAD_EVENT =
            io.grpc.MethodDescriptor.create(
                    io.grpc.MethodDescriptor.MethodType.UNARY,
                    generateFullMethodName(
                            "edge.UploadService", "UploadEvent"),
                    io.grpc.protobuf.ProtoUtils.marshaller(edge.EdgeMessage.RequestData.getDefaultInstance()),
                    io.grpc.protobuf.ProtoUtils.marshaller(edge.EdgeMessage.Result.getDefaultInstance()));

    /**
     * Creates a new async stub that supports all call types for the service
     */
    public static UploadServiceStub newStub(io.grpc.Channel channel) {
        return new UploadServiceStub(channel);
    }

    /**
     * Creates a new blocking-style stub that supports unary and streaming output calls on the service
     */
    public static UploadServiceBlockingStub newBlockingStub(
            io.grpc.Channel channel) {
        return new UploadServiceBlockingStub(channel);
    }

    /**
     * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
     */
    public static UploadServiceFutureStub newFutureStub(
            io.grpc.Channel channel) {
        return new UploadServiceFutureStub(channel);
    }

    /**
     * <pre>
     * 数据上报方法定义
     * </pre>
     */
    public static abstract class UploadServiceImplBase implements io.grpc.BindableService {

        /**
         * <pre>
         * 设备注册
         * </pre>
         */
        public void registerDevice(edge.EdgeMessage.RequestData request,
                                   io.grpc.stub.StreamObserver<edge.EdgeMessage.Result> responseObserver) {
            asyncUnimplementedUnaryCall(METHOD_REGISTER_DEVICE, responseObserver);
        }

        /**
         * <pre>
         * 上报状态
         * </pre>
         */
        public void uploadStatus(edge.EdgeMessage.RequestData request,
                                 io.grpc.stub.StreamObserver<edge.EdgeMessage.Result> responseObserver) {
            asyncUnimplementedUnaryCall(METHOD_UPLOAD_STATUS, responseObserver);
        }

        /**
         * <pre>
         * 上报属性
         * </pre>
         */
        public void uploadProperty(edge.EdgeMessage.RequestData request,
                                   io.grpc.stub.StreamObserver<edge.EdgeMessage.Result> responseObserver) {
            asyncUnimplementedUnaryCall(METHOD_UPLOAD_PROPERTY, responseObserver);
        }

        /**
         * <pre>
         * 上报事件
         * </pre>
         */
        public void uploadEvent(edge.EdgeMessage.RequestData request,
                                io.grpc.stub.StreamObserver<edge.EdgeMessage.Result> responseObserver) {
            asyncUnimplementedUnaryCall(METHOD_UPLOAD_EVENT, responseObserver);
        }

        @java.lang.Override
        public io.grpc.ServerServiceDefinition bindService() {
            return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
                    .addMethod(
                            METHOD_REGISTER_DEVICE,
                            asyncUnaryCall(
                                    new MethodHandlers<
                                            edge.EdgeMessage.RequestData,
                                            edge.EdgeMessage.Result>(
                                            this, METHODID_REGISTER_DEVICE)))
                    .addMethod(
                            METHOD_UPLOAD_STATUS,
                            asyncUnaryCall(
                                    new MethodHandlers<
                                            edge.EdgeMessage.RequestData,
                                            edge.EdgeMessage.Result>(
                                            this, METHODID_UPLOAD_STATUS)))
                    .addMethod(
                            METHOD_UPLOAD_PROPERTY,
                            asyncUnaryCall(
                                    new MethodHandlers<
                                            edge.EdgeMessage.RequestData,
                                            edge.EdgeMessage.Result>(
                                            this, METHODID_UPLOAD_PROPERTY)))
                    .addMethod(
                            METHOD_UPLOAD_EVENT,
                            asyncUnaryCall(
                                    new MethodHandlers<
                                            edge.EdgeMessage.RequestData,
                                            edge.EdgeMessage.Result>(
                                            this, METHODID_UPLOAD_EVENT)))
                    .build();
        }
    }

    /**
     * <pre>
     * 数据上报方法定义
     * </pre>
     */
    public static final class UploadServiceStub extends io.grpc.stub.AbstractStub<UploadServiceStub> {
        private UploadServiceStub(io.grpc.Channel channel) {
            super(channel);
        }

        private UploadServiceStub(io.grpc.Channel channel,
                                  io.grpc.CallOptions callOptions) {
            super(channel, callOptions);
        }

        @java.lang.Override
        protected UploadServiceStub build(io.grpc.Channel channel,
                                          io.grpc.CallOptions callOptions) {
            return new UploadServiceStub(channel, callOptions);
        }

        /**
         * <pre>
         * 设备注册
         * </pre>
         */
        public void registerDevice(edge.EdgeMessage.RequestData request,
                                   io.grpc.stub.StreamObserver<edge.EdgeMessage.Result> responseObserver) {
            asyncUnaryCall(
                    getChannel().newCall(METHOD_REGISTER_DEVICE, getCallOptions()), request, responseObserver);
        }

        /**
         * <pre>
         * 上报状态
         * </pre>
         */
        public void uploadStatus(edge.EdgeMessage.RequestData request,
                                 io.grpc.stub.StreamObserver<edge.EdgeMessage.Result> responseObserver) {
            asyncUnaryCall(
                    getChannel().newCall(METHOD_UPLOAD_STATUS, getCallOptions()), request, responseObserver);
        }

        /**
         * <pre>
         * 上报属性
         * </pre>
         */
        public void uploadProperty(edge.EdgeMessage.RequestData request,
                                   io.grpc.stub.StreamObserver<edge.EdgeMessage.Result> responseObserver) {
            asyncUnaryCall(
                    getChannel().newCall(METHOD_UPLOAD_PROPERTY, getCallOptions()), request, responseObserver);
        }

        /**
         * <pre>
         * 上报事件
         * </pre>
         */
        public void uploadEvent(edge.EdgeMessage.RequestData request,
                                io.grpc.stub.StreamObserver<edge.EdgeMessage.Result> responseObserver) {
            asyncUnaryCall(
                    getChannel().newCall(METHOD_UPLOAD_EVENT, getCallOptions()), request, responseObserver);
        }
    }

    /**
     * <pre>
     * 数据上报方法定义
     * </pre>
     */
    public static final class UploadServiceBlockingStub extends io.grpc.stub.AbstractStub<UploadServiceBlockingStub> {
        private UploadServiceBlockingStub(io.grpc.Channel channel) {
            super(channel);
        }

        private UploadServiceBlockingStub(io.grpc.Channel channel,
                                          io.grpc.CallOptions callOptions) {
            super(channel, callOptions);
        }

        @java.lang.Override
        protected UploadServiceBlockingStub build(io.grpc.Channel channel,
                                                  io.grpc.CallOptions callOptions) {
            return new UploadServiceBlockingStub(channel, callOptions);
        }

        /**
         * <pre>
         * 设备注册
         * </pre>
         */
        public edge.EdgeMessage.Result registerDevice(edge.EdgeMessage.RequestData request) {
            return blockingUnaryCall(
                    getChannel(), METHOD_REGISTER_DEVICE, getCallOptions(), request);
        }

        /**
         * <pre>
         * 上报状态
         * </pre>
         */
        public edge.EdgeMessage.Result uploadStatus(edge.EdgeMessage.RequestData request) {
            return blockingUnaryCall(
                    getChannel(), METHOD_UPLOAD_STATUS, getCallOptions(), request);
        }

        /**
         * <pre>
         * 上报属性
         * </pre>
         */
        public edge.EdgeMessage.Result uploadProperty(edge.EdgeMessage.RequestData request) {
            return blockingUnaryCall(
                    getChannel(), METHOD_UPLOAD_PROPERTY, getCallOptions(), request);
        }

        /**
         * <pre>
         * 上报事件
         * </pre>
         */
        public edge.EdgeMessage.Result uploadEvent(edge.EdgeMessage.RequestData request) {
            return blockingUnaryCall(
                    getChannel(), METHOD_UPLOAD_EVENT, getCallOptions(), request);
        }
    }

    /**
     * <pre>
     * 数据上报方法定义
     * </pre>
     */
    public static final class UploadServiceFutureStub extends io.grpc.stub.AbstractStub<UploadServiceFutureStub> {
        private UploadServiceFutureStub(io.grpc.Channel channel) {
            super(channel);
        }

        private UploadServiceFutureStub(io.grpc.Channel channel,
                                        io.grpc.CallOptions callOptions) {
            super(channel, callOptions);
        }

        @java.lang.Override
        protected UploadServiceFutureStub build(io.grpc.Channel channel,
                                                io.grpc.CallOptions callOptions) {
            return new UploadServiceFutureStub(channel, callOptions);
        }

        /**
         * <pre>
         * 设备注册
         * </pre>
         */
        public com.google.common.util.concurrent.ListenableFuture<edge.EdgeMessage.Result> registerDevice(
                edge.EdgeMessage.RequestData request) {
            return futureUnaryCall(
                    getChannel().newCall(METHOD_REGISTER_DEVICE, getCallOptions()), request);
        }

        /**
         * <pre>
         * 上报状态
         * </pre>
         */
        public com.google.common.util.concurrent.ListenableFuture<edge.EdgeMessage.Result> uploadStatus(
                edge.EdgeMessage.RequestData request) {
            return futureUnaryCall(
                    getChannel().newCall(METHOD_UPLOAD_STATUS, getCallOptions()), request);
        }

        /**
         * <pre>
         * 上报属性
         * </pre>
         */
        public com.google.common.util.concurrent.ListenableFuture<edge.EdgeMessage.Result> uploadProperty(
                edge.EdgeMessage.RequestData request) {
            return futureUnaryCall(
                    getChannel().newCall(METHOD_UPLOAD_PROPERTY, getCallOptions()), request);
        }

        /**
         * <pre>
         * 上报事件
         * </pre>
         */
        public com.google.common.util.concurrent.ListenableFuture<edge.EdgeMessage.Result> uploadEvent(
                edge.EdgeMessage.RequestData request) {
            return futureUnaryCall(
                    getChannel().newCall(METHOD_UPLOAD_EVENT, getCallOptions()), request);
        }
    }

    private static final int METHODID_REGISTER_DEVICE = 0;
    private static final int METHODID_UPLOAD_STATUS = 1;
    private static final int METHODID_UPLOAD_PROPERTY = 2;
    private static final int METHODID_UPLOAD_EVENT = 3;

    private static class MethodHandlers<Req, Resp> implements
            io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
            io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
            io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
            io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
        private final UploadServiceImplBase serviceImpl;
        private final int methodId;

        public MethodHandlers(UploadServiceImplBase serviceImpl, int methodId) {
            this.serviceImpl = serviceImpl;
            this.methodId = methodId;
        }

        @java.lang.Override
        @java.lang.SuppressWarnings("unchecked")
        public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
            switch (methodId) {
                case METHODID_REGISTER_DEVICE:
                    serviceImpl.registerDevice((edge.EdgeMessage.RequestData) request,
                            (io.grpc.stub.StreamObserver<edge.EdgeMessage.Result>) responseObserver);
                    break;
                case METHODID_UPLOAD_STATUS:
                    serviceImpl.uploadStatus((edge.EdgeMessage.RequestData) request,
                            (io.grpc.stub.StreamObserver<edge.EdgeMessage.Result>) responseObserver);
                    break;
                case METHODID_UPLOAD_PROPERTY:
                    serviceImpl.uploadProperty((edge.EdgeMessage.RequestData) request,
                            (io.grpc.stub.StreamObserver<edge.EdgeMessage.Result>) responseObserver);
                    break;
                case METHODID_UPLOAD_EVENT:
                    serviceImpl.uploadEvent((edge.EdgeMessage.RequestData) request,
                            (io.grpc.stub.StreamObserver<edge.EdgeMessage.Result>) responseObserver);
                    break;
                default:
                    throw new AssertionError();
            }
        }

        @java.lang.Override
        @java.lang.SuppressWarnings("unchecked")
        public io.grpc.stub.StreamObserver<Req> invoke(
                io.grpc.stub.StreamObserver<Resp> responseObserver) {
            switch (methodId) {
                default:
                    throw new AssertionError();
            }
        }
    }

    public static io.grpc.ServiceDescriptor getServiceDescriptor() {
        return new io.grpc.ServiceDescriptor(SERVICE_NAME,
                METHOD_REGISTER_DEVICE,
                METHOD_UPLOAD_STATUS,
                METHOD_UPLOAD_PROPERTY,
                METHOD_UPLOAD_EVENT);
    }

}
